<html>
 <head>
  <title>Haiti Mobile Application Demo</title>
 </head>
 <body>

<?php
mysql_connect('129.74.153.54', 'HA_User', 'hag') or die (mysql_error());
mysql_select_db('HA_database') or die (mysql_error());
$result = mysql_query("SELECT * from structures");

//Table starting tag and header cells
echo "<table border='1'>
	<tr>
	<th>Struct Name</th>
	<th>Description</th>

	<th>Address</th>
        <th>Surveyor Name</th>
        <th>Phone Number</th>

        <th>Ownership</th>
        <th>Year</th>
        <th>Duration</th>
        <th>Builder</th>

        <th>Steel Walls</th>
        <th># Floors</th>
        <th>Roof Type</th>
        <th># Children</th>
        <th># Adults</th>

        <th>Photo Front</th>
        <th>Photo Right</th>
        <th>Photo Back</th>
        <th>Photo Left</th>

	</tr>";

while($row = mysql_fetch_array($result)){
	//Display the results in different cells
	echo 	"<tr><td>" 
		. $row['structureName'] 		
		. "</td><td>" 
		. $row['structureDesc'] 
		
		. "</td><td>" 
		. $row['structureAddress'] 
		. "</td><td>"
                . $row['surveyorName']
                . "</td><td>"
                . $row['phoneNumber']

                . "</td><td>"
                . $row['structureOwned']
                . "</td><td>"
                . $row['yearBuilt']
                . "</td><td>"
                . $row['buildDuration']
                . "</td><td>"
                . $row['builder']

                . "</td><td>"
                . $row['steelWalls']
                . "</td><td>"
                . $row['nFloors']
                . "</td><td>"
                . $row['roofType']
                . "</td><td>"
                . $row['nChildren']
                . "</td><td>"
                . $row['nAdults']

                . "</td><td>"
                . $row['photoFront']
                . "</td><td>"
                . $row['photoRight']
                . "</td><td>"
                . $row['photoBack']
                . "</td><td>"
                . $row['photoLeft']
	
		. "</td></tr>";
}

//Table closing tag
echo "</table>";

mysql_close();

?>

</body>
</html>

